<template>
    <div>
        child---{{ title }}
    </div>
    <div>
        {{ props.title }}
    </div>
    <button @click="handleClick">click</button>
</template>
<script setup>

//父传子props
const props = defineProps({
    title: {
        type: String,
        default: '000'
    }
})

//子传父emit
const emit = defineEmits(["childEvent"])

const handleClick = () => {
    emit("childEvent", "子组件的消息")
}

</script>